<?php
namespace app\common\model;
use think\Model;
use think\Validate;
use app\common\controller\Tools;
class PageCategory extends Model
{
	protected $table = 'page_category';

	public static function changeDel($page_cate_id)
	{
		$r1 = db('page')->where('page_cate_id', $page_cate_id)->delete();
		$r2 = PageCategory::where('page_category_id', $page_cate_id)->setField('page_category_is_delete', 1);
		if($r1 && $r1)
		{
			return true;
		}else
		{
			return false;
		}
	} 



	public static function showlist()
	{
		$where['page_category_is_delete'] = ['eq', 0];
		$data = PageCategory::where($where)->order('page_category_id', 'desc')->select();	
		return $data;
	}

}